package com.yxq.mdt.app.modules.spikeorder.ui.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yxq.mdt.app.R;
import com.yxq.mdt.app.glide.GlideHelper;
import com.yxq.mdt.app.modules.shoppingcart.bean.CartBean;

import java.util.List;

/**
 * @author L
 * @time 2019-10-21
 * @describe 确认订单购买的商品列表
 */
public class SpikeOrderConfirmGoodsListAdapter extends BaseQuickAdapter<CartBean.ListBean, BaseViewHolder> {

    public SpikeOrderConfirmGoodsListAdapter(int layoutResId, @Nullable List<CartBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CartBean.ListBean item) {

        GlideHelper.setLoadRoundImage(mContext, item.getGoods_pic(), 0, helper.getView(R.id.order_confirm_goods_list_iv_img));
    }

    @Override
    public int getItemCount() {
        //最多只显示4件商品
        return super.getItemCount() > 4 ? 4 : super.getItemCount();
    }
}
